package edu.sctu.zcy.month201505.day20150522;

/**
 * Created by user24 on 2015/5/22.
 */
public class ArmyRunnable implements Runnable {

    volatile boolean keepRunning = true;

    @Override
    public void run() {
        while (keepRunning){
            for (int i = 0; i < 5; i++) {

                System.out.println(Thread.currentThread().getName()+"攻击对方["+i+"]");
                Thread.yield();

            }
        }
        System.out.println(Thread.currentThread().getName()+"结束了战斗");

    }
}
